package fr.upstlse.glre.client.widgets.fields;

import static fr.upstlse.glre.client.RfgConstante.LOGIN_FIELD_IDENTIFIANT_LABEL;
import static fr.upstlse.glre.client.RfgConstante.LOGIN_FIELD_IDENTIFIANT_NAME;
import static fr.upstlse.glre.client.RfgConstante.LOGIN_FIELD_MOTDEPASSE_LABEL;
import static fr.upstlse.glre.client.RfgConstante.LOGIN_FIELD_MOTDEPASSE_NAME;

import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.TextField;

public class LoginFields implements IFields {

	FormPanel formPanel;
	
	TextField login;
	TextField motDePasse;
	
	public LoginFields(FormPanel pFormPanel) {
		formPanel = pFormPanel;
		
		login = new TextField();
		motDePasse = new TextField();
		
		createFields();
	}
	
	public void createFields() {
		login.setFieldLabel(LOGIN_FIELD_IDENTIFIANT_LABEL);
		login.setName(LOGIN_FIELD_IDENTIFIANT_NAME);
		formPanel.add(login);
		
		motDePasse.setPassword(true);
		motDePasse.setFieldLabel(LOGIN_FIELD_MOTDEPASSE_LABEL);
		motDePasse.setName(LOGIN_FIELD_MOTDEPASSE_NAME);
		formPanel.add(motDePasse);
	}

	public void setFieldsValues() {
		// TODO Auto-generated method stub
		
	}

	public void removeFields() {
		// TODO Auto-generated method stub

	}

	public FormPanel getFormPanel() {
		return formPanel;
	}

	public void setFormPanel(FormPanel formPanel) {
		this.formPanel = formPanel;
	}

	public TextField getLogin() {
		return login;
	}

	public void setLogin(TextField login) {
		this.login = login;
	}

	public TextField getMotDePasse() {
		return motDePasse;
	}

	public void setMotDePasse(TextField motDePasse) {
		this.motDePasse = motDePasse;
	}

	public ComboBox getRole() {
		// TODO Auto-generated method stub
		return null;
	}
}
